https://leetcode.cn/problems/counting-bits/description/
class Solution {
public:
    int GetBits(int n)
    {
        int ret=0;
        for(int i=0;i<=31;i++)
            if((n>>i)&1)
                ret++;
        return ret;
    }       
        
    
    vector<int> countBits(int n) {
        vector<int> ret;
        ret.push_back(0);
        for(int i=1;i<=n;i++)
            ret.push_back(GetBits(i));
        return ret;
    }
};